]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Factor out a function to load the default theme
authorMaxim Ermilov <zaspire@rambler.ru>
Tue, 4 Jan 2011 19:30:03 +0000 (14:30 -0500)
committerFederico Mena Quintero <federico@gnome.org>
Fri, 7 Jan 2011 20:21:48 +0000 (15:21 -0500)
We will use this function elsewhere when the theme needs to be reloaded.

https://bugzilla.gnome.org/show_bug.cgi?id=630428

js/ui/main.js

index e08781bfc6c7e443ef895326dc9417a7f4297450..86e510237435bb010ffde072bec77bab351c2b6d 100644 (file)
@@ -109,10 +109,7 @@ function start() {
     global.stage.color = DEFAULT_BACKGROUND_COLOR;
     global.stage.no_clear_hint = true;
 
-    let themeContext = St.ThemeContext.get_for_stage (global.stage);
-    let stylesheetPath = global.datadir + '/theme/gnome-shell.css';
-    let theme = new St.Theme ({ application_stylesheet: stylesheetPath });
-    themeContext.set_theme (theme);
+    loadTheme();
 
     let shellwm = global.window_manager;
     shellwm.takeover_keybinding('panel_main_menu');
@@ -201,6 +198,18 @@ function start() {
     }
 }
 
+/**
+ * loadTheme:
+ *
+ * Reloads the theme CSS file from the default theme.
+ */
+function loadTheme() {
+    let themeContext = St.ThemeContext.get_for_stage (global.stage);
+    let stylesheetPath = global.datadir + '/theme/gnome-shell.css';
+    let theme = new St.Theme ({ application_stylesheet: stylesheetPath });
+    themeContext.set_theme (theme);
+}
+
 /**
  * _log:
  * @category: string message type ('info', 'error')